package com.youlu.campus.monitor.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
import java.util.Arrays;

@Configuration
public class MongoLocalTimeConfig {

    @Bean
    public MongoCustomConversions mongoCustomConversions() {
        // 注册自定义的 LocalTime 序列化/反序列化转换器
        return new MongoCustomConversions(Arrays.asList(
                new LocalTimeToDateConverter(),
                new DateToLocalTimeConverter()
        ));
    }
}